<?php

function attachMenu()
{
    $menu = [];
    if (env('APP_DEBUG') && request()->ip() === '127.0.0.1') {
        $menu[] = [
            'title'     => '主题风格',
            'css'       => 'layui-icon-theme',
            'sub_title' => '主题',
            'child'     => [
                [
                    'href'  => url('theme/h5')->build(),
                    'title' => 'H5手机端'
                ],

            ]
        ];
        $menu[] = [
            'title'     => '插件管理',
            'sub_title' => '插件',
            'child'     => [
                [
                    'href'  => url('addons/index')->build(),
                    'title' => '插件列表'
                ],

            ]
        ];
    }
    if (env('APP_DEBUG') && config('tool')['task']) {
        $menu[] = [
            'title'     => '定时任务',
            'sub_title' => '定时',
            'child'     => [
                [
                    'href'  => url('test/index')->build(),
                    'title' => '任务列表'
                ],

            ]
        ];
    }
    return $menu;
}

